package com.dlink.sqljobsync.listener;

import com.dlink.sqljobsync.propertie.DlinkSqlProperties;
import com.dlink.sqljobsync.utils.DlinkSyncHttpTool;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author 应用启动完成监听器
 */
@Component
@Slf4j
public class UserApplicationReadyEvent implements ApplicationListener<ApplicationReadyEvent> {
    @Autowired
    DlinkSqlProperties dlinkSqlProperties;
    @Override
    public void onApplicationEvent(ApplicationReadyEvent ApplicationReadyEvent) {
        log.info("线程池初始化成功，启动完成，可以接收执行任务。。。。");
        DlinkSyncHttpTool.executeSql();
    }
}